<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>旋转动画</title>
    <link rel="stylesheet" href="../libs/bootstrap/css/bootstrap.min.css">
    <script src="../libs/jquery3_1_1.min.js"></script>
    <style>
        .box{
            width:200px;
            height: 150px;
            margin:50px auto;
            display: flex;
            align-items: center;
            justify-content: center;
            border: 1px solid #cccccc;
            overflow: hidden;
            position: relative;
            border-radius: 5px;

            box-shadow: 0 0 20px 0 #888;
        }

        .box img{
            vertical-align: top;
            width: 100%;
            height: 100%;
            transition: all 1s;
        }

        .box:after{
            content: '夏威夷美景';
            width: 100%;
            height: 100%;
            background-color: rgba(0,0,0,0.4);
            display: flex;
            justify-content: center;
            align-items: center;
            color: #f8f8f8;
            position: absolute;
            font-family: 'Arial', "Microsoft YaHei UI";
            font-size: 18px;

            transition: all 0.5s;
            opacity: 0;
        }
        .box:hover:after{
            opacity: 1;
        }

        .box:hover img{
            width: 120%;
            height: 120%;
        }
    </style>
</head>
<body>
<div class="container">
    <div class="box">
        <img src="http://img01.cztv.com/201701/24/eca045adcac2b59f752952f4bbda41ac.jpg" alt="">
    </div>
</div>
</body>
</html>
<script>
    $(".box:after").attr({"data-content":"这是修改后的"});
</script>